home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Freeware / Gobby 0.4.7 / gobby-0.4.7.exe / {app} / share / gtksourceview-2.0 / language-specs / makefile.lang < prev    next >
Extensible Markup Language  |  2008-09-09  |  6KB  |  194 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Author: Paolo Borelli <pborelli@katamail.com>
  5.  Copyright (C) 2005 Paolo Borelli <pborelli@katamail.com>
  6.  Copyright (C) 2005 Ricardo Lenz
  7.  
  8.  This library is free software; you can redistribute it and/or
  9.  modify it under the terms of the GNU Library General Public
  10.  License as published by the Free Software Foundation; either
  11.  version 2 of the License, or (at your option) any later version.
  12.  
  13.  This library is distributed in the hope that it will be useful,
  14.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  Library General Public License for more details.
  17.  
  18.  You should have received a copy of the GNU Library General Public
  19.  License along with this library; if not, write to the
  20.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.  Boston, MA 02111-1307, USA.
  22.  
  23. -->
  24. <language id="makefile" _name="Makefile" version="2.0" _section="Sources">
  25.   <metadata>
  26.     <property name="mimetypes">text/x-makefile</property>
  27.     <property name="globs">[Mm]akefile;GNUmakefile;[Mm]akefile.*</property>
  28.     <property name="line-comment-start">#</property>
  29.   </metadata>
  30.  
  31.   <styles>
  32.     <style id="variable"        name="Variable" map-to="def:type"/>
  33.     <style id="assignment-rhs"  name="assignment-rhs"/>
  34.     <style id="assignment-lhs"  name="assignment-lhs"/>
  35.     <style id="targets"         name="targets" map-to="def:function"/>
  36.     <style id="prereq"          name="prereq"/>
  37.     <style id="command"         name="command"/>
  38.     <style id="trailing-tab"    name="Trailing Tab"/>
  39.     <style id="function"        name="function" map-to="def:function"/>
  40.     <style id="keyword"         name="keyword" map-to="def:keyword"/>
  41.   </styles>
  42.  
  43.   <definitions>
  44.     <define-regex id="variable">[a-zA-Z_][a-zA-Z0-9_]*</define-regex>
  45.  
  46.     <context id="variable-1">
  47.       <match>\$\((\%{variable})\)</match>
  48.       <include>
  49.         <context sub-pattern="1" style-ref="variable"/>
  50.       </include>
  51.     </context>
  52.  
  53.     <context id="variable-2">
  54.       <match>\$\{(\%{variable})\}</match>
  55.       <include>
  56.         <context sub-pattern="1" style-ref="variable"/>
  57.       </include>
  58.     </context>
  59.  
  60.     <context id="variable">
  61.       <include>
  62.         <context ref="variable-1"/>
  63.         <context ref="variable-2"/>
  64.       </include>
  65.     </context>
  66.  
  67.     <context id="backtick-string" style-ref="function" end-at-line-end="true">
  68.       <start>`</start>
  69.       <end>`</end>
  70.       <include>
  71.         <context ref="def:escape"/>
  72.         <context ref="def:line-continue"/>
  73.       </include>
  74.     </context>
  75.  
  76.     <context id="string">
  77.       <include>
  78.     <!-- skip escaped characters -->
  79.         <context>
  80.           <match>\\.</match>
  81.         </context>
  82.         <context ref="def:string"/>
  83.       </include>
  84.     </context>
  85.  
  86.     <context id="assignment-rhs" style-ref="assignment-rhs" end-at-line-end="true">
  87.       <start></start>
  88.       <include>
  89.         <context ref="def:line-continue"/>
  90.         <context ref="def:shell-like-comment"/>
  91.         <context ref="variable"/>
  92.         <context ref="string"/>
  93.         <context ref="def:single-quoted-string"/>
  94.         <context ref="backtick-string"/>
  95.       </include>
  96.     </context>
  97.  
  98.     <context id="command" style-ref="command" extend-parent="false" end-at-line-end="true">
  99.       <start></start>
  100.       <include>
  101.         <context ref="def:line-continue"/>
  102.         <context ref="def:shell-like-comment"/>
  103.         <context ref="variable"/>
  104.         <context ref="string"/>
  105.         <context ref="def:single-quoted-string"/>
  106.         <context ref="backtick-string"/>
  107.       </include>
  108.     </context>
  109.  
  110.     <context id="directives" style-ref="keyword">
  111.       <keyword>define</keyword>
  112.       <keyword>else</keyword>
  113.       <keyword>endef</keyword>
  114.       <keyword>endif</keyword>
  115.       <keyword>if</keyword>
  116.       <keyword>ifdef</keyword>
  117.       <keyword>ifeq</keyword>
  118.       <keyword>ifndef</keyword>
  119.       <keyword>ifneq</keyword>
  120.       <keyword>include</keyword>
  121.       <keyword>override</keyword>
  122.       <keyword>unexport</keyword>
  123.     </context>
  124.  
  125.     <context id="functions" style-ref="function">
  126.       <keyword>addprefix</keyword>
  127.       <keyword>addsuffix</keyword>
  128.       <keyword>basename</keyword>
  129.       <keyword>call</keyword>
  130.       <keyword>dir</keyword>
  131.       <keyword>error</keyword>
  132.       <keyword>filter</keyword>
  133.       <keyword>filter-out</keyword>
  134.       <keyword>findstring</keyword>
  135.       <keyword>firstword</keyword>
  136.       <keyword>foreach</keyword>
  137.       <keyword>join</keyword>
  138.       <keyword>notdir</keyword>
  139.       <keyword>origin</keyword>
  140.       <keyword>patsubst</keyword>
  141.       <keyword>shell</keyword>
  142.       <keyword>sort</keyword>
  143.       <keyword>strip</keyword>
  144.       <keyword>subst</keyword>
  145.       <keyword>suffix</keyword>
  146.       <keyword>warning</keyword>
  147.       <keyword>wildcard</keyword>
  148.       <keyword>word</keyword>
  149.       <keyword>words</keyword>
  150.     </context>
  151.  
  152.     <context id="makefile">
  153.       <include>
  154.         <context ref="def:shebang"/>
  155.         <context ref="def:shell-like-comment"/>
  156.  
  157.         <context id="assignment" end-at-line-end="true">
  158.           <start>^(\%{variable})\s*[\+]?=</start>
  159.             <include>
  160.               <context sub-pattern="1" where="start" style-ref="assignment-lhs"/>
  161.               <context ref="assignment-rhs"/>
  162.             </include>
  163.         </context>
  164.  
  165.         <context id="rule">
  166.           <start>^([^\t\:][^\:]*)\:</start>
  167.           <end>^(?!\t)</end>
  168.           <include>
  169.             <context sub-pattern="1" where="start" style-ref="targets"/>
  170.             <context id="prereq" end-at-line-end="true" style-ref="prereq">
  171.               <start>(?<=:)(?=.)</start>
  172.               <end>;</end>
  173.               <include>
  174.                 <context ref="def:escape"/>
  175.                 <context ref="def:line-continue"/>
  176.                 <context ref="variable"/>
  177.                 <context ref="functions"/>
  178.               </include>
  179.             </context>
  180.             <context id="trailing-tab" style-ref="trailing-tab">
  181.               <match>^\t+$</match>
  182.             </context>
  183.             <context ref="command"/>
  184.           </include>
  185.         </context>
  186.  
  187.         <context ref="directives"/>
  188.         <context ref="functions"/>
  189.  
  190.       </include>
  191.     </context>
  192.   </definitions>
  193. </language>
  194.